<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        var htmlParts = ["<a id=\"a\"><b id=\"b\">hey!<\/b><\/a>"];
        var myBlob = new Blob(htmlParts, { "type": "text\/xml" });


        var a = document.createElement("a");
        a.href = window.URL.createObjectURL(myBlob);
        a.download = "hello-world.txt";
        a.textContent = "Download Hello World!";

        document.body.appendChild(a);

    </script>

</body>

</html>